using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace RA_WebSite.Models.Mapping
{
    public class ProvinoMap : EntityTypeConfiguration<Provino>
    {
        public ProvinoMap()
        {

            this.HasKey(t => t.Id);

            this.ToTable("Provino");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.Coordinate).HasColumnName("Coordinate");
            this.Property(t => t.Step_Id).HasColumnName("Step_Id");

            this.HasOptional(t => t.Step)
                .WithMany(t => t.Provinoes)
                .HasForeignKey(d => d.Step_Id)
                .WillCascadeOnDelete(true);

        }
    }
}
